package com.xbang.attendance.service;

import java.util.Date;
import java.util.List;

import com.xbang.attendance.entity.product.Product;
import com.xbang.attendance.entity.stock.InventoryWarningRecord;
import com.xbang.attendance.entity.system.MaintenanceStation;
import com.xbang.attendance.entity.system.Region;
import com.xbang.attendance.entity.system.Warehouse;
import com.xbang.attendance.entity.system.WarehouseProductAgreement;
import com.xbang.core.service.BaseService;

/**
 * @author huawei
 * @email alonelaval@gmail.com
 */
public interface WarehouseService extends BaseService {
	/***
	 * 得到仓储
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	Warehouse getWarehouse(Integer id) throws Exception;

	/**
	 * 得到地区
	 * 
	 * @param name
	 * @return
	 * @throws Exception
	 */
	Region getRegionByName(String name) throws Exception;
	/**
	 *查找某个地区编码下的经销商
	 */
	List<Warehouse> getWarehousesByRegion(String regionNumber)throws Exception;

	/**
	 * 得到服务商
	 * 
	 * @param ascNumber
	 * @return
	 * @throws Exception
	 */
	MaintenanceStation getMaintenanceStationByCode(String ascNumber) throws Exception;

	/**
	 * 根据名称得到仓储
	 * 
	 * @param name
	 * @return
	 * @throws Exception
	 */
	Warehouse getWarehouseByName(String name) throws Exception;

	/***
	 * 根据编码得到仓储
	 * 
	 * @param code
	 * @return
	 * @throws Exception
	 */
	Warehouse getWarehouseByCode(String code) throws Exception;

	/**
	 * 根据web路径生成excel,并返回该文件的名称
	 * 
	 * @param webPath
	 *            服务器路径
	 * @return
	 * @throws Exception
	 */
	String genericExcelFile(String webPath, String[] fields) throws Exception;

	/**
	 * 发送某条预警信息邮件
	 * 
	 * @param inventoryWarningRecord
	 * @throws Exception
	 */
	void sendWarehouseWarnMail(InventoryWarningRecord inventoryWarningRecord) throws Exception;

	/***
	 * 根据仓库，产品得到他的约定数量
	 * 
	 * @param warehouse
	 * @param product
	 * @return
	 * @throws Exception
	 */
	WarehouseProductAgreement getWarehouseProductAgreement(Warehouse warehouse, Product product) throws Exception;
	/***
	 *  产生送货单excel文件
	 * @param webPath web路径
	 * @param templatePath 模板路径
	 * @return 文件路径
	 * @throws Exception
	 */
	String genericExcelFile(String webPath,Integer warehouseId,Date beginDate,Date endDate) throws Exception;
	
	/***
	 *  产生送货单excel文件
	 * @param webPath web路径
	 * @param templatePath 模板路径
	 * @return 文件路径
	 * @throws Exception
	 */
	String genericExcelFile(String webPath,String po,Integer warehouseId,Date beginDate,Date endDate) throws Exception;
	
	/***
	 *  产生送货单excel文件
	 * @param webPath web路径
	 * @param templatePath 模板路径
	 * @return 文件路径
	 * @throws Exception
	 */
	String genericExcelFile(String webPath,String type) throws Exception;
	
}
